﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

public partial class TournamentPage : System.Web.UI.Page
{
    public bool TepPlayoffs;

    protected void Page_Load(object sender, EventArgs e)
    {
        AjaxPro.Utility.RegisterTypeForAjax(typeof(TournamentPage));
          Configuration rootWebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
          TepPlayoffs = bool.Parse(rootWebConfig.AppSettings.Settings["PlayoffsTEPMode"].Value.ToString());
    }
    [AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.Read)]
    public int CreateTournament(string p_Tournament_Name, string p_Tournament_Logo, int p_NumberOfQualifyRounds, int p_NumberOfPlayoffRounds, int p_NumberOfQualifyPlayersToPlayoffs, int p_TournamentType)
    {
        try
        {            
            return Tournament.CreateTournament(p_Tournament_Name, p_Tournament_Logo, p_NumberOfQualifyRounds, p_NumberOfPlayoffRounds, p_NumberOfQualifyPlayersToPlayoffs, p_TournamentType);
            
        }
        catch(Exception Ex)
        {
            throw;
        }
    }
}
